#include "IOMutiplexing.h"
#include "Select_Impl.h"

IOMutiplexing::IOMutiplexing()
{
    if (NULL == implementation_)
    {
        implementation_ = new Select_Impl;
    }
     
}


IOMutiplexing::~IOMutiplexing()
{
    if (implementation_ != NULL)
    {
        delete implementation_;
    }
}


int IOMutiplexing::register_handler( const int fd, int flag, Event_Handler* handler)
{
    return implementation_->register_handler(fd, flag, handler);
}

void IOMutiplexing::remove_handler( const int fd )
{
    return implementation_->remove_handler(fd);
}

void IOMutiplexing::run_event_loop()
{
    implementation_->run_event_loop();
}